<template>
  <div id="app">
    <span @click="goPage('/')" :class="{activeTitle: isShow}"><font size="6px">单条新闻</font></span>
    &nbsp;&nbsp;&nbsp;
    <span @click="goPage('/moneyNews')" :class="{activeTitle: !isShow}"><font size="6px">多条新闻</font></span>
    <router-view/>
  </div>
</template>

<script>

export default {
  name: 'App',
  components: {},
  data(){
    return{
      isShow: true,   //判断样式
    }
  },
  methods:{
    goPage(path){
      this.isShow = !this.isShow;
      this.$router.push(path);
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}


span:hover{
  color: mediumpurple;
  cursor: pointer;
}
.activeTitle{
  color: cornflowerblue;
}
</style>
